<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>LoginByName</title>
    <link rel="StyleSheet" href="../css/login.css" type="text/css" media="screen" />
    <link rel="StyleSheet" href="../css/common.css" type="text/css" media="screen" />
    <script src="https://kit.fontawesome.com/58cb2985af.js" crossorigin="anonymous"></script>
</head>
<body>
    <div th:replace="common/top"></div>

    <div id="w">
        <div class="loginContent">

            <div class="loginTitle">
                <a id="btn1" class="btn" href="/user/loginByNameForm" role="button">Account Login</a>
                <a class="btn" href="/user/loginByPhoneForm" role="button">SMS Login</a>
            </div>

            <form class="loginForm" action="/user/loginByName" method="post">
                <div th:if="${errorMsg} != null" class="errorContent">
                    <p th:text="${errorMsg}" id="error" name="error">error</p>
                </div>

                <div class="loginFormItem">
                    <label for="username" class="loginFormLabel">
                        <i class="fa-solid fa-user"></i>
                    </label>
                    <input type="text" class="loginFormInput" name="username" id="username" placeholder="请输入用户名">
                </div>

                <div class="loginFormItem">
                    <label for="password" class="loginFormLabel">
                        <i class="fa-solid fa-lock"></i>
                    </label>
                    <input type="password" class="loginFormInput" name="password" id="password" placeholder="请输入密码">
                </div>

                <div class="loginFormItem">
                    <label for="code" class="loginFormLabel">
                        <i class="fa-solid fa-shield-halved"></i>
                    </label>
                    <input type="text" class="loginFormInputCode" name="code" id="code" placeholder="请输入验证码">
                    <img alt="单击图片刷新！" class="pointer" src="/common/kaptcha"
                         onclick="this.src='/common/kaptcha?d='+new Date()*1">
                </div>

                <div class="loginFormLink">
                    <a href="/user/resetPasswordForm" class="link">忘记密码?</a>
                </div>

                <div class="loginFormItemSubmit">
                    <input type="submit" class="loginFormSubmit" value="Login">
                </div>

                <div class="loginFormLink">
                    <a href="/user/loginByGitee" class="link1">第三方登录</a>
                    <a href="/register" class="link2">没有账号? 去注册</a>
                </div>
            </form>
        </div>
    </div>

    <div th:replace="common/bottom"></div>
</body>
</html>